-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Python IndexError of Case14: paddle.nn.functional.glu #50016
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为这个case加个单测吧
python/paddle/tensor/manipulation.py
Outdated
@@ -1918,6 +1918,7 @@ def split(x, num_or_sections, axis=0, name=None): | |||
dim = dim.numpy() | |||
dim = dim.item(0) | |||
assert len(input.shape) + dim >= 0, "(rank(x) + axis) must >= 0" | |||
assert dim < len(input.shape), "axis must < (rank(x)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(rank(x)是不是应该改成rank(x)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对的,我的疏忽
python/paddle/tensor/manipulation.py
Outdated
@@ -1997,6 +1998,7 @@ def _get_SectionsTensorList(one_list): | |||
inputs['AxisTensor'] = dim | |||
else: | |||
assert len(input.shape) + dim >= 0, "(rank(x) + axis) must >= 0" | |||
assert dim < len(input.shape), "axis must < (rank(x)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
单测我今天搞定 |
单测添加好了 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Bug fixes
PR changes
APIs
Describe
Solution
原因:glu函数的axis取值要求小于x.shape
解决方法:添加axis取值判断条件